home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!hpl3sn03.cern.ch
- From: Dan Pop <danpop@mail.cern.ch>
- Newsgroups: comp.unix.osf.osf1,comp.lang.c
- Subject: Re: printf-problem
- Date: Thu, 18 Jan 1996 21:18:56 +0100
- Organization: CERN European Lab for Particle Physics
- Message-ID: <9601182018.AA15332@dxmint.cern.ch>
- References: <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de> <821915961snz@genesis.demon.co.uk> <DLDs8G.JJ9@cwi.nl>
- X-NNTP-Posting-Host: hpl3sn03.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
- X-Mail2News-Path: dxmint.cern.ch!hpl3sn03.cern.ch
-
- dik@cwi.nl (Dik T. Winter) writes:
-
- >In article <821915961snz@genesis.demon.co.uk> fred@genesis.demon.co.uk writes:
- > > In article <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de>
- > > wist@lam.mw.tu-muenchen.de "Henrik Wist" writes:
- > > >long int zahl; /* which is e.g. 10000500001 */
- > > >printf("%d\n",zahl); /* gives 1410565409, which is definitly wrong */
- > > >.
- > > >
- > > >Is that a problem of printf() or DG-UX or is it my problem that I don't know
- > > >the right conversion for printf(). Btw, printf("%u",zahl) didn't work either.
- > > RTFM. 'man printf' will almost certainly tell you that the conversion
- > > specifier for longs is %ld.
- >
- >Alas, the FM will not tell him that the value is too large and does not
- >fit in the variable zahl, so only the lower 32 bits are retained.
-
- Huh???
-
- The Newsgroups line strongly suggests that he was using a DEC OSF/1
- system and 10000500001 fits quite well in 64 bits (the size of long int
- on that platform).
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-